package com.lcb.jmm.atomic;

import java.util.concurrent.atomic.AtomicIntegerArray;

/****
 * @Author:刘长柏
 * @Date: 2021-01-05 14:28
 * @Description: 数组类型
 *****/
public class AtomicIntegerArrayTest {

    static int[] value = new int[]{1, 2};

    static AtomicIntegerArray atomicIntegerArray = new AtomicIntegerArray(value);

    public static void main(String[] args) {
        atomicIntegerArray.getAndSet(0, 3);

        System.out.println(atomicIntegerArray.get(0));
        System.out.println(value[0]);

        System.out.println(atomicIntegerArray.get(0) == value[0]);

    }
}
